package com.wbl.tijianssm.controller;

import com.wbl.tijianssm.pojo.Hospital;
import com.wbl.tijianssm.pojo.Orders;
import com.wbl.tijianssm.response.ApiRestResponse;
import com.wbl.tijianssm.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/order")
@RestController
public class OrdersController {

    @Autowired
    OrdersService ordersService;

    @ResponseBody
    @PutMapping("/confirmOrder")
    public ApiRestResponse ConfirmOrder(@RequestBody Orders order){
        return ordersService.ConfirmOrder(order);
    }

    @ResponseBody
    @PostMapping("/orderlist")
    public ApiRestResponse getOrderlist(@RequestBody Orders order){
        return ordersService.getOrderlist(order);
    }

    @ResponseBody
    @PutMapping("/editOrder")
    public ApiRestResponse editOrder(@RequestBody Orders order){
        return ordersService.editOrder(order);
    }



//    @ResponseBody
//    @PostMapping("/orderdetail")
//    public ApiRestResponse getOrderById(@RequestBody Orders order){
//        return ordersService.getOrderById(order);
//    }
}
